package net.zwet.clanworks.connectors.eve.api.connector.url;

import java.util.ArrayList;

import org.apache.http.message.BasicNameValuePair;

/**
 * This class will hold all the parameters required to make a connection to the eveonline api
 * when authorization is required. The constructor will create the parameters userId and apiKey
 * which must always be provided. Any other parameter can be added by using the addParameter method.
 * 
 *  The getParameters method will be used by the ConnectorBase.
 * 
 * @author Rick
 *
 */

public class Parameters {
	public static String KEY_ID = "keyID";
	public static String VERIFICATION_CODE = "vCode";

	private ArrayList<BasicNameValuePair> parameters = new ArrayList<BasicNameValuePair>();

	public Parameters() {
		parameters.add(new BasicNameValuePair(KEY_ID, ""));
		parameters.add(new BasicNameValuePair(VERIFICATION_CODE, ""));
	}

	public Parameters(String id, String key) {
		if (parameters.size() > 0 ) {
			parameters.clear();
		}
		
		parameters.add(new BasicNameValuePair(KEY_ID, id));
		parameters.add(new BasicNameValuePair(VERIFICATION_CODE, key));
	}
	
	public void addParameter(String key, String value) {
		parameters.add(new BasicNameValuePair(key, value));
	}

	public ArrayList<BasicNameValuePair> getParameters() {
		return parameters;
	}
}

